/**
 * 
 */
package com.ekingstar.framework.action;

import org.apache.struts2.config.Action;
import org.apache.struts2.config.Result;

import com.opensymphony.xwork2.ActionSupport;
import com.ekingstar.framework.domain.Function;
import com.ekingstar.framework.service.IFunctionService;

/**
 * 
 *
 */
@Action(name="view",namespace="/function")
public class ViewFunctionAction extends ActionSupport{

	private IFunctionService functionService;
	public void setFunctionService(IFunctionService functionService) {
		this.functionService = functionService;
	}
	private Function function;
	
	public Function getFunction() {
		return function;
	}
	public void setFunction(Function function) {
		this.function = function;
	}
	
	
	public String execute(){
		if (function != null && function.getId() !=null){
			function = functionService.viewFunction(function.getId());
		}
		return "input";
	}
	
	
}
